package myRule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: my-cloud-study
 * @description:
 * @author: zhaiming
 * @create: 2020-12-08 16:20
 **/
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule(){
        return new RandomRule();
    }

    /*@Resource
    private DicoveryClient dicoveryClient;

    public List<ServiceInstance> getAllServiceInstances(String serviceName){
        List<ServiceInstance> list = dicoveryClient.getInstances(serviceName);
    }*/
}
